package com.hitqz.robot.driver.zmq.protocol.component;


import com.hitqz.robot.driver.zmq.protocol.message.ProtocolMessage;

import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * 存储zmq消息队列工具类
 */
public class MsgQueue {

    public static ConcurrentLinkedQueue<ProtocolMessage> SEND_MESSAGE_LIST = new ConcurrentLinkedQueue<>();

    public static ProtocolMessage deleteOne(){
       return MsgQueue.SEND_MESSAGE_LIST.poll();
    }

    public static void addOne(final ProtocolMessage protocolMessage){
        MsgQueue.SEND_MESSAGE_LIST.add(protocolMessage);
    }

    public static boolean isEmpty() {
        return MsgQueue.SEND_MESSAGE_LIST.isEmpty();
    }


}
